<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.util.List,java.sql.Connection,com.java1234.util.DbUtil,com.java1234.dao.carDao,com.java1234.dao.animalDao,java.util.ArrayList"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>购物车</title>
</head>
<body>
<br><br>
<%
		String aid = request.getParameter("ID");
		String aprice = request.getParameter("Price");
		String username = request.getParameter("Username");
		DbUtil dbUtil=new DbUtil();
		carDao cardao = new carDao();
		animalDao animaldao = new animalDao();
		List <String> mcars = new ArrayList<String>();
		Connection con=null;
		try {
			con=dbUtil.getCon();
			int n = cardao.add(con,username,aid,aprice);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		};
			mcars.add(aid);
			session.setAttribute("cars",mcars);
			
		
		response.sendRedirect("carmanager.jsp");
		%>
		
</body>
</html>